
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace POSSystem.DAL
{
	public abstract class _RepairJob : SqlClientEntity
	{
		public _RepairJob()
		{
			this.QuerySource = "RepairJob";
			this.MappingName = "RepairJob";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_RepairJobLoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int ID)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.ID, ID);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_RepairJobLoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static SqlParameter ID
			{
				get
				{
					return new SqlParameter("@ID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter RepairNo
			{
				get
				{
					return new SqlParameter("@RepairNo", SqlDbType.Char, 10);
				}
			}
			
			public static SqlParameter RepairModelID
			{
				get
				{
					return new SqlParameter("@RepairModelID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter IMEI
			{
				get
				{
					return new SqlParameter("@IMEI", SqlDbType.NVarChar, 20);
				}
			}
			
			public static SqlParameter StatusID
			{
				get
				{
					return new SqlParameter("@StatusID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter Note
			{
				get
				{
					return new SqlParameter("@Note", SqlDbType.NVarChar, 1073741823);
				}
			}
			
			public static SqlParameter Accessories
			{
				get
				{
					return new SqlParameter("@Accessories", SqlDbType.NVarChar, 100);
				}
			}
			
			public static SqlParameter CustomerID
			{
				get
				{
					return new SqlParameter("@CustomerID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter CustomerName
			{
				get
				{
					return new SqlParameter("@CustomerName", SqlDbType.NVarChar, 50);
				}
			}
			
			public static SqlParameter CustomerPhone
			{
				get
				{
					return new SqlParameter("@CustomerPhone", SqlDbType.NVarChar, 20);
				}
			}
			
			public static SqlParameter Deleted
			{
				get
				{
					return new SqlParameter("@Deleted", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter LastModifiedDate
			{
				get
				{
					return new SqlParameter("@LastModifiedDate", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter LastModifiedByUser
			{
				get
				{
					return new SqlParameter("@LastModifiedByUser", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter CreatedDate
			{
				get
				{
					return new SqlParameter("@CreatedDate", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter CreatedByUser
			{
				get
				{
					return new SqlParameter("@CreatedByUser", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter InvoiceID
			{
				get
				{
					return new SqlParameter("@InvoiceID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter IsRetail
			{
				get
				{
					return new SqlParameter("@IsRetail", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter IsRedo
			{
				get
				{
					return new SqlParameter("@IsRedo", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter RepairBoxID
			{
				get
				{
					return new SqlParameter("@RepairBoxID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter PreviousStatusID
			{
				get
				{
					return new SqlParameter("@PreviousStatusID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter LoanPhoneID
			{
				get
				{
					return new SqlParameter("@LoanPhoneID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter LoanPhoneReturn
			{
				get
				{
					return new SqlParameter("@LoanPhoneReturn", SqlDbType.Bit, 0);
				}
			}
			
			public static SqlParameter BranchID
			{
				get
				{
					return new SqlParameter("@BranchID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter InvoiceDetailID
			{
				get
				{
					return new SqlParameter("@InvoiceDetailID", SqlDbType.Int, 0);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string ID = "ID";
            public const string RepairNo = "RepairNo";
            public const string RepairModelID = "RepairModelID";
            public const string IMEI = "IMEI";
            public const string StatusID = "StatusID";
            public const string Note = "Note";
            public const string Accessories = "Accessories";
            public const string CustomerID = "CustomerID";
            public const string CustomerName = "CustomerName";
            public const string CustomerPhone = "CustomerPhone";
            public const string Deleted = "Deleted";
            public const string LastModifiedDate = "LastModifiedDate";
            public const string LastModifiedByUser = "LastModifiedByUser";
            public const string CreatedDate = "CreatedDate";
            public const string CreatedByUser = "CreatedByUser";
            public const string InvoiceID = "InvoiceID";
            public const string IsRetail = "IsRetail";
            public const string IsRedo = "IsRedo";
            public const string RepairBoxID = "RepairBoxID";
            public const string PreviousStatusID = "PreviousStatusID";
            public const string LoanPhoneID = "LoanPhoneID";
            public const string LoanPhoneReturn = "LoanPhoneReturn";
            public const string BranchID = "BranchID";
            public const string InvoiceDetailID = "InvoiceDetailID";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _RepairJob.PropertyNames.ID;
					ht[RepairNo] = _RepairJob.PropertyNames.RepairNo;
					ht[RepairModelID] = _RepairJob.PropertyNames.RepairModelID;
					ht[IMEI] = _RepairJob.PropertyNames.IMEI;
					ht[StatusID] = _RepairJob.PropertyNames.StatusID;
					ht[Note] = _RepairJob.PropertyNames.Note;
					ht[Accessories] = _RepairJob.PropertyNames.Accessories;
					ht[CustomerID] = _RepairJob.PropertyNames.CustomerID;
					ht[CustomerName] = _RepairJob.PropertyNames.CustomerName;
					ht[CustomerPhone] = _RepairJob.PropertyNames.CustomerPhone;
					ht[Deleted] = _RepairJob.PropertyNames.Deleted;
					ht[LastModifiedDate] = _RepairJob.PropertyNames.LastModifiedDate;
					ht[LastModifiedByUser] = _RepairJob.PropertyNames.LastModifiedByUser;
					ht[CreatedDate] = _RepairJob.PropertyNames.CreatedDate;
					ht[CreatedByUser] = _RepairJob.PropertyNames.CreatedByUser;
					ht[InvoiceID] = _RepairJob.PropertyNames.InvoiceID;
					ht[IsRetail] = _RepairJob.PropertyNames.IsRetail;
					ht[IsRedo] = _RepairJob.PropertyNames.IsRedo;
					ht[RepairBoxID] = _RepairJob.PropertyNames.RepairBoxID;
					ht[PreviousStatusID] = _RepairJob.PropertyNames.PreviousStatusID;
					ht[LoanPhoneID] = _RepairJob.PropertyNames.LoanPhoneID;
					ht[LoanPhoneReturn] = _RepairJob.PropertyNames.LoanPhoneReturn;
					ht[BranchID] = _RepairJob.PropertyNames.BranchID;
					ht[InvoiceDetailID] = _RepairJob.PropertyNames.InvoiceDetailID;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string ID = "ID";
            public const string RepairNo = "RepairNo";
            public const string RepairModelID = "RepairModelID";
            public const string IMEI = "IMEI";
            public const string StatusID = "StatusID";
            public const string Note = "Note";
            public const string Accessories = "Accessories";
            public const string CustomerID = "CustomerID";
            public const string CustomerName = "CustomerName";
            public const string CustomerPhone = "CustomerPhone";
            public const string Deleted = "Deleted";
            public const string LastModifiedDate = "LastModifiedDate";
            public const string LastModifiedByUser = "LastModifiedByUser";
            public const string CreatedDate = "CreatedDate";
            public const string CreatedByUser = "CreatedByUser";
            public const string InvoiceID = "InvoiceID";
            public const string IsRetail = "IsRetail";
            public const string IsRedo = "IsRedo";
            public const string RepairBoxID = "RepairBoxID";
            public const string PreviousStatusID = "PreviousStatusID";
            public const string LoanPhoneID = "LoanPhoneID";
            public const string LoanPhoneReturn = "LoanPhoneReturn";
            public const string BranchID = "BranchID";
            public const string InvoiceDetailID = "InvoiceDetailID";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _RepairJob.ColumnNames.ID;
					ht[RepairNo] = _RepairJob.ColumnNames.RepairNo;
					ht[RepairModelID] = _RepairJob.ColumnNames.RepairModelID;
					ht[IMEI] = _RepairJob.ColumnNames.IMEI;
					ht[StatusID] = _RepairJob.ColumnNames.StatusID;
					ht[Note] = _RepairJob.ColumnNames.Note;
					ht[Accessories] = _RepairJob.ColumnNames.Accessories;
					ht[CustomerID] = _RepairJob.ColumnNames.CustomerID;
					ht[CustomerName] = _RepairJob.ColumnNames.CustomerName;
					ht[CustomerPhone] = _RepairJob.ColumnNames.CustomerPhone;
					ht[Deleted] = _RepairJob.ColumnNames.Deleted;
					ht[LastModifiedDate] = _RepairJob.ColumnNames.LastModifiedDate;
					ht[LastModifiedByUser] = _RepairJob.ColumnNames.LastModifiedByUser;
					ht[CreatedDate] = _RepairJob.ColumnNames.CreatedDate;
					ht[CreatedByUser] = _RepairJob.ColumnNames.CreatedByUser;
					ht[InvoiceID] = _RepairJob.ColumnNames.InvoiceID;
					ht[IsRetail] = _RepairJob.ColumnNames.IsRetail;
					ht[IsRedo] = _RepairJob.ColumnNames.IsRedo;
					ht[RepairBoxID] = _RepairJob.ColumnNames.RepairBoxID;
					ht[PreviousStatusID] = _RepairJob.ColumnNames.PreviousStatusID;
					ht[LoanPhoneID] = _RepairJob.ColumnNames.LoanPhoneID;
					ht[LoanPhoneReturn] = _RepairJob.ColumnNames.LoanPhoneReturn;
					ht[BranchID] = _RepairJob.ColumnNames.BranchID;
					ht[InvoiceDetailID] = _RepairJob.ColumnNames.InvoiceDetailID;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string ID = "s_ID";
            public const string RepairNo = "s_RepairNo";
            public const string RepairModelID = "s_RepairModelID";
            public const string IMEI = "s_IMEI";
            public const string StatusID = "s_StatusID";
            public const string Note = "s_Note";
            public const string Accessories = "s_Accessories";
            public const string CustomerID = "s_CustomerID";
            public const string CustomerName = "s_CustomerName";
            public const string CustomerPhone = "s_CustomerPhone";
            public const string Deleted = "s_Deleted";
            public const string LastModifiedDate = "s_LastModifiedDate";
            public const string LastModifiedByUser = "s_LastModifiedByUser";
            public const string CreatedDate = "s_CreatedDate";
            public const string CreatedByUser = "s_CreatedByUser";
            public const string InvoiceID = "s_InvoiceID";
            public const string IsRetail = "s_IsRetail";
            public const string IsRedo = "s_IsRedo";
            public const string RepairBoxID = "s_RepairBoxID";
            public const string PreviousStatusID = "s_PreviousStatusID";
            public const string LoanPhoneID = "s_LoanPhoneID";
            public const string LoanPhoneReturn = "s_LoanPhoneReturn";
            public const string BranchID = "s_BranchID";
            public const string InvoiceDetailID = "s_InvoiceDetailID";

		}
		#endregion		
		
		#region Properties
	
		public virtual int ID
	    {
			get
	        {
				return base.Getint(ColumnNames.ID);
			}
			set
	        {
				base.Setint(ColumnNames.ID, value);
			}
		}

		public virtual string RepairNo
	    {
			get
	        {
				return base.Getstring(ColumnNames.RepairNo);
			}
			set
	        {
				base.Setstring(ColumnNames.RepairNo, value);
			}
		}

		public virtual int RepairModelID
	    {
			get
	        {
				return base.Getint(ColumnNames.RepairModelID);
			}
			set
	        {
				base.Setint(ColumnNames.RepairModelID, value);
			}
		}

		public virtual string IMEI
	    {
			get
	        {
				return base.Getstring(ColumnNames.IMEI);
			}
			set
	        {
				base.Setstring(ColumnNames.IMEI, value);
			}
		}

		public virtual int StatusID
	    {
			get
	        {
				return base.Getint(ColumnNames.StatusID);
			}
			set
	        {
				base.Setint(ColumnNames.StatusID, value);
			}
		}

		public virtual string Note
	    {
			get
	        {
				return base.Getstring(ColumnNames.Note);
			}
			set
	        {
				base.Setstring(ColumnNames.Note, value);
			}
		}

		public virtual string Accessories
	    {
			get
	        {
				return base.Getstring(ColumnNames.Accessories);
			}
			set
	        {
				base.Setstring(ColumnNames.Accessories, value);
			}
		}

		public virtual int CustomerID
	    {
			get
	        {
				return base.Getint(ColumnNames.CustomerID);
			}
			set
	        {
				base.Setint(ColumnNames.CustomerID, value);
			}
		}

		public virtual string CustomerName
	    {
			get
	        {
				return base.Getstring(ColumnNames.CustomerName);
			}
			set
	        {
				base.Setstring(ColumnNames.CustomerName, value);
			}
		}

		public virtual string CustomerPhone
	    {
			get
	        {
				return base.Getstring(ColumnNames.CustomerPhone);
			}
			set
	        {
				base.Setstring(ColumnNames.CustomerPhone, value);
			}
		}

		public virtual bool Deleted
	    {
			get
	        {
				return base.Getbool(ColumnNames.Deleted);
			}
			set
	        {
				base.Setbool(ColumnNames.Deleted, value);
			}
		}

		public virtual DateTime LastModifiedDate
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.LastModifiedDate);
			}
			set
	        {
				base.SetDateTime(ColumnNames.LastModifiedDate, value);
			}
		}

		public virtual int LastModifiedByUser
	    {
			get
	        {
				return base.Getint(ColumnNames.LastModifiedByUser);
			}
			set
	        {
				base.Setint(ColumnNames.LastModifiedByUser, value);
			}
		}

		public virtual DateTime CreatedDate
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.CreatedDate);
			}
			set
	        {
				base.SetDateTime(ColumnNames.CreatedDate, value);
			}
		}

		public virtual int CreatedByUser
	    {
			get
	        {
				return base.Getint(ColumnNames.CreatedByUser);
			}
			set
	        {
				base.Setint(ColumnNames.CreatedByUser, value);
			}
		}

		public virtual int InvoiceID
	    {
			get
	        {
				return base.Getint(ColumnNames.InvoiceID);
			}
			set
	        {
				base.Setint(ColumnNames.InvoiceID, value);
			}
		}

		public virtual bool IsRetail
	    {
			get
	        {
				return base.Getbool(ColumnNames.IsRetail);
			}
			set
	        {
				base.Setbool(ColumnNames.IsRetail, value);
			}
		}

		public virtual bool IsRedo
	    {
			get
	        {
				return base.Getbool(ColumnNames.IsRedo);
			}
			set
	        {
				base.Setbool(ColumnNames.IsRedo, value);
			}
		}

		public virtual int RepairBoxID
	    {
			get
	        {
				return base.Getint(ColumnNames.RepairBoxID);
			}
			set
	        {
				base.Setint(ColumnNames.RepairBoxID, value);
			}
		}

		public virtual int PreviousStatusID
	    {
			get
	        {
				return base.Getint(ColumnNames.PreviousStatusID);
			}
			set
	        {
				base.Setint(ColumnNames.PreviousStatusID, value);
			}
		}

		public virtual int LoanPhoneID
	    {
			get
	        {
				return base.Getint(ColumnNames.LoanPhoneID);
			}
			set
	        {
				base.Setint(ColumnNames.LoanPhoneID, value);
			}
		}

		public virtual bool LoanPhoneReturn
	    {
			get
	        {
				return base.Getbool(ColumnNames.LoanPhoneReturn);
			}
			set
	        {
				base.Setbool(ColumnNames.LoanPhoneReturn, value);
			}
		}

		public virtual int BranchID
	    {
			get
	        {
				return base.Getint(ColumnNames.BranchID);
			}
			set
	        {
				base.Setint(ColumnNames.BranchID, value);
			}
		}

		public virtual int InvoiceDetailID
	    {
			get
	        {
				return base.Getint(ColumnNames.InvoiceDetailID);
			}
			set
	        {
				base.Setint(ColumnNames.InvoiceDetailID, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ID) ? string.Empty : base.GetintAsString(ColumnNames.ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ID);
				else
					this.ID = base.SetintAsString(ColumnNames.ID, value);
			}
		}

		public virtual string s_RepairNo
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.RepairNo) ? string.Empty : base.GetstringAsString(ColumnNames.RepairNo);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.RepairNo);
				else
					this.RepairNo = base.SetstringAsString(ColumnNames.RepairNo, value);
			}
		}

		public virtual string s_RepairModelID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.RepairModelID) ? string.Empty : base.GetintAsString(ColumnNames.RepairModelID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.RepairModelID);
				else
					this.RepairModelID = base.SetintAsString(ColumnNames.RepairModelID, value);
			}
		}

		public virtual string s_IMEI
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IMEI) ? string.Empty : base.GetstringAsString(ColumnNames.IMEI);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IMEI);
				else
					this.IMEI = base.SetstringAsString(ColumnNames.IMEI, value);
			}
		}

		public virtual string s_StatusID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.StatusID) ? string.Empty : base.GetintAsString(ColumnNames.StatusID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.StatusID);
				else
					this.StatusID = base.SetintAsString(ColumnNames.StatusID, value);
			}
		}

		public virtual string s_Note
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Note) ? string.Empty : base.GetstringAsString(ColumnNames.Note);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Note);
				else
					this.Note = base.SetstringAsString(ColumnNames.Note, value);
			}
		}

		public virtual string s_Accessories
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Accessories) ? string.Empty : base.GetstringAsString(ColumnNames.Accessories);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Accessories);
				else
					this.Accessories = base.SetstringAsString(ColumnNames.Accessories, value);
			}
		}

		public virtual string s_CustomerID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CustomerID) ? string.Empty : base.GetintAsString(ColumnNames.CustomerID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CustomerID);
				else
					this.CustomerID = base.SetintAsString(ColumnNames.CustomerID, value);
			}
		}

		public virtual string s_CustomerName
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CustomerName) ? string.Empty : base.GetstringAsString(ColumnNames.CustomerName);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CustomerName);
				else
					this.CustomerName = base.SetstringAsString(ColumnNames.CustomerName, value);
			}
		}

		public virtual string s_CustomerPhone
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CustomerPhone) ? string.Empty : base.GetstringAsString(ColumnNames.CustomerPhone);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CustomerPhone);
				else
					this.CustomerPhone = base.SetstringAsString(ColumnNames.CustomerPhone, value);
			}
		}

		public virtual string s_Deleted
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.Deleted) ? string.Empty : base.GetboolAsString(ColumnNames.Deleted);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.Deleted);
				else
					this.Deleted = base.SetboolAsString(ColumnNames.Deleted, value);
			}
		}

		public virtual string s_LastModifiedDate
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LastModifiedDate) ? string.Empty : base.GetDateTimeAsString(ColumnNames.LastModifiedDate);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LastModifiedDate);
				else
					this.LastModifiedDate = base.SetDateTimeAsString(ColumnNames.LastModifiedDate, value);
			}
		}

		public virtual string s_LastModifiedByUser
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LastModifiedByUser) ? string.Empty : base.GetintAsString(ColumnNames.LastModifiedByUser);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LastModifiedByUser);
				else
					this.LastModifiedByUser = base.SetintAsString(ColumnNames.LastModifiedByUser, value);
			}
		}

		public virtual string s_CreatedDate
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CreatedDate) ? string.Empty : base.GetDateTimeAsString(ColumnNames.CreatedDate);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CreatedDate);
				else
					this.CreatedDate = base.SetDateTimeAsString(ColumnNames.CreatedDate, value);
			}
		}

		public virtual string s_CreatedByUser
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CreatedByUser) ? string.Empty : base.GetintAsString(ColumnNames.CreatedByUser);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CreatedByUser);
				else
					this.CreatedByUser = base.SetintAsString(ColumnNames.CreatedByUser, value);
			}
		}

		public virtual string s_InvoiceID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.InvoiceID) ? string.Empty : base.GetintAsString(ColumnNames.InvoiceID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.InvoiceID);
				else
					this.InvoiceID = base.SetintAsString(ColumnNames.InvoiceID, value);
			}
		}

		public virtual string s_IsRetail
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IsRetail) ? string.Empty : base.GetboolAsString(ColumnNames.IsRetail);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IsRetail);
				else
					this.IsRetail = base.SetboolAsString(ColumnNames.IsRetail, value);
			}
		}

		public virtual string s_IsRedo
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.IsRedo) ? string.Empty : base.GetboolAsString(ColumnNames.IsRedo);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.IsRedo);
				else
					this.IsRedo = base.SetboolAsString(ColumnNames.IsRedo, value);
			}
		}

		public virtual string s_RepairBoxID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.RepairBoxID) ? string.Empty : base.GetintAsString(ColumnNames.RepairBoxID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.RepairBoxID);
				else
					this.RepairBoxID = base.SetintAsString(ColumnNames.RepairBoxID, value);
			}
		}

		public virtual string s_PreviousStatusID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.PreviousStatusID) ? string.Empty : base.GetintAsString(ColumnNames.PreviousStatusID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.PreviousStatusID);
				else
					this.PreviousStatusID = base.SetintAsString(ColumnNames.PreviousStatusID, value);
			}
		}

		public virtual string s_LoanPhoneID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LoanPhoneID) ? string.Empty : base.GetintAsString(ColumnNames.LoanPhoneID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LoanPhoneID);
				else
					this.LoanPhoneID = base.SetintAsString(ColumnNames.LoanPhoneID, value);
			}
		}

		public virtual string s_LoanPhoneReturn
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.LoanPhoneReturn) ? string.Empty : base.GetboolAsString(ColumnNames.LoanPhoneReturn);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.LoanPhoneReturn);
				else
					this.LoanPhoneReturn = base.SetboolAsString(ColumnNames.LoanPhoneReturn, value);
			}
		}

		public virtual string s_BranchID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.BranchID) ? string.Empty : base.GetintAsString(ColumnNames.BranchID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.BranchID);
				else
					this.BranchID = base.SetintAsString(ColumnNames.BranchID, value);
			}
		}

		public virtual string s_InvoiceDetailID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.InvoiceDetailID) ? string.Empty : base.GetintAsString(ColumnNames.InvoiceDetailID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.InvoiceDetailID);
				else
					this.InvoiceDetailID = base.SetintAsString(ColumnNames.InvoiceDetailID, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter RepairNo
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.RepairNo, Parameters.RepairNo);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter RepairModelID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.RepairModelID, Parameters.RepairModelID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IMEI
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IMEI, Parameters.IMEI);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter StatusID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.StatusID, Parameters.StatusID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Note
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Note, Parameters.Note);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Accessories
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Accessories, Parameters.Accessories);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CustomerID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CustomerID, Parameters.CustomerID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CustomerName
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CustomerName, Parameters.CustomerName);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CustomerPhone
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CustomerPhone, Parameters.CustomerPhone);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter Deleted
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.Deleted, Parameters.Deleted);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LastModifiedDate
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LastModifiedDate, Parameters.LastModifiedDate);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LastModifiedByUser
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LastModifiedByUser, Parameters.LastModifiedByUser);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CreatedDate
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CreatedDate, Parameters.CreatedDate);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CreatedByUser
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CreatedByUser, Parameters.CreatedByUser);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter InvoiceID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.InvoiceID, Parameters.InvoiceID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IsRetail
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IsRetail, Parameters.IsRetail);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter IsRedo
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.IsRedo, Parameters.IsRedo);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter RepairBoxID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.RepairBoxID, Parameters.RepairBoxID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter PreviousStatusID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.PreviousStatusID, Parameters.PreviousStatusID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LoanPhoneID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LoanPhoneID, Parameters.LoanPhoneID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter LoanPhoneReturn
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.LoanPhoneReturn, Parameters.LoanPhoneReturn);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter BranchID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.BranchID, Parameters.BranchID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter InvoiceDetailID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.InvoiceDetailID, Parameters.InvoiceDetailID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public WhereParameter RepairNo
		    {
				get
		        {
					if(_RepairNo_W == null)
	        	    {
						_RepairNo_W = TearOff.RepairNo;
					}
					return _RepairNo_W;
				}
			}

			public WhereParameter RepairModelID
		    {
				get
		        {
					if(_RepairModelID_W == null)
	        	    {
						_RepairModelID_W = TearOff.RepairModelID;
					}
					return _RepairModelID_W;
				}
			}

			public WhereParameter IMEI
		    {
				get
		        {
					if(_IMEI_W == null)
	        	    {
						_IMEI_W = TearOff.IMEI;
					}
					return _IMEI_W;
				}
			}

			public WhereParameter StatusID
		    {
				get
		        {
					if(_StatusID_W == null)
	        	    {
						_StatusID_W = TearOff.StatusID;
					}
					return _StatusID_W;
				}
			}

			public WhereParameter Note
		    {
				get
		        {
					if(_Note_W == null)
	        	    {
						_Note_W = TearOff.Note;
					}
					return _Note_W;
				}
			}

			public WhereParameter Accessories
		    {
				get
		        {
					if(_Accessories_W == null)
	        	    {
						_Accessories_W = TearOff.Accessories;
					}
					return _Accessories_W;
				}
			}

			public WhereParameter CustomerID
		    {
				get
		        {
					if(_CustomerID_W == null)
	        	    {
						_CustomerID_W = TearOff.CustomerID;
					}
					return _CustomerID_W;
				}
			}

			public WhereParameter CustomerName
		    {
				get
		        {
					if(_CustomerName_W == null)
	        	    {
						_CustomerName_W = TearOff.CustomerName;
					}
					return _CustomerName_W;
				}
			}

			public WhereParameter CustomerPhone
		    {
				get
		        {
					if(_CustomerPhone_W == null)
	        	    {
						_CustomerPhone_W = TearOff.CustomerPhone;
					}
					return _CustomerPhone_W;
				}
			}

			public WhereParameter Deleted
		    {
				get
		        {
					if(_Deleted_W == null)
	        	    {
						_Deleted_W = TearOff.Deleted;
					}
					return _Deleted_W;
				}
			}

			public WhereParameter LastModifiedDate
		    {
				get
		        {
					if(_LastModifiedDate_W == null)
	        	    {
						_LastModifiedDate_W = TearOff.LastModifiedDate;
					}
					return _LastModifiedDate_W;
				}
			}

			public WhereParameter LastModifiedByUser
		    {
				get
		        {
					if(_LastModifiedByUser_W == null)
	        	    {
						_LastModifiedByUser_W = TearOff.LastModifiedByUser;
					}
					return _LastModifiedByUser_W;
				}
			}

			public WhereParameter CreatedDate
		    {
				get
		        {
					if(_CreatedDate_W == null)
	        	    {
						_CreatedDate_W = TearOff.CreatedDate;
					}
					return _CreatedDate_W;
				}
			}

			public WhereParameter CreatedByUser
		    {
				get
		        {
					if(_CreatedByUser_W == null)
	        	    {
						_CreatedByUser_W = TearOff.CreatedByUser;
					}
					return _CreatedByUser_W;
				}
			}

			public WhereParameter InvoiceID
		    {
				get
		        {
					if(_InvoiceID_W == null)
	        	    {
						_InvoiceID_W = TearOff.InvoiceID;
					}
					return _InvoiceID_W;
				}
			}

			public WhereParameter IsRetail
		    {
				get
		        {
					if(_IsRetail_W == null)
	        	    {
						_IsRetail_W = TearOff.IsRetail;
					}
					return _IsRetail_W;
				}
			}

			public WhereParameter IsRedo
		    {
				get
		        {
					if(_IsRedo_W == null)
	        	    {
						_IsRedo_W = TearOff.IsRedo;
					}
					return _IsRedo_W;
				}
			}

			public WhereParameter RepairBoxID
		    {
				get
		        {
					if(_RepairBoxID_W == null)
	        	    {
						_RepairBoxID_W = TearOff.RepairBoxID;
					}
					return _RepairBoxID_W;
				}
			}

			public WhereParameter PreviousStatusID
		    {
				get
		        {
					if(_PreviousStatusID_W == null)
	        	    {
						_PreviousStatusID_W = TearOff.PreviousStatusID;
					}
					return _PreviousStatusID_W;
				}
			}

			public WhereParameter LoanPhoneID
		    {
				get
		        {
					if(_LoanPhoneID_W == null)
	        	    {
						_LoanPhoneID_W = TearOff.LoanPhoneID;
					}
					return _LoanPhoneID_W;
				}
			}

			public WhereParameter LoanPhoneReturn
		    {
				get
		        {
					if(_LoanPhoneReturn_W == null)
	        	    {
						_LoanPhoneReturn_W = TearOff.LoanPhoneReturn;
					}
					return _LoanPhoneReturn_W;
				}
			}

			public WhereParameter BranchID
		    {
				get
		        {
					if(_BranchID_W == null)
	        	    {
						_BranchID_W = TearOff.BranchID;
					}
					return _BranchID_W;
				}
			}

			public WhereParameter InvoiceDetailID
		    {
				get
		        {
					if(_InvoiceDetailID_W == null)
	        	    {
						_InvoiceDetailID_W = TearOff.InvoiceDetailID;
					}
					return _InvoiceDetailID_W;
				}
			}

			private WhereParameter _ID_W = null;
			private WhereParameter _RepairNo_W = null;
			private WhereParameter _RepairModelID_W = null;
			private WhereParameter _IMEI_W = null;
			private WhereParameter _StatusID_W = null;
			private WhereParameter _Note_W = null;
			private WhereParameter _Accessories_W = null;
			private WhereParameter _CustomerID_W = null;
			private WhereParameter _CustomerName_W = null;
			private WhereParameter _CustomerPhone_W = null;
			private WhereParameter _Deleted_W = null;
			private WhereParameter _LastModifiedDate_W = null;
			private WhereParameter _LastModifiedByUser_W = null;
			private WhereParameter _CreatedDate_W = null;
			private WhereParameter _CreatedByUser_W = null;
			private WhereParameter _InvoiceID_W = null;
			private WhereParameter _IsRetail_W = null;
			private WhereParameter _IsRedo_W = null;
			private WhereParameter _RepairBoxID_W = null;
			private WhereParameter _PreviousStatusID_W = null;
			private WhereParameter _LoanPhoneID_W = null;
			private WhereParameter _LoanPhoneReturn_W = null;
			private WhereParameter _BranchID_W = null;
			private WhereParameter _InvoiceDetailID_W = null;

			public void WhereClauseReset()
			{
				_ID_W = null;
				_RepairNo_W = null;
				_RepairModelID_W = null;
				_IMEI_W = null;
				_StatusID_W = null;
				_Note_W = null;
				_Accessories_W = null;
				_CustomerID_W = null;
				_CustomerName_W = null;
				_CustomerPhone_W = null;
				_Deleted_W = null;
				_LastModifiedDate_W = null;
				_LastModifiedByUser_W = null;
				_CreatedDate_W = null;
				_CreatedByUser_W = null;
				_InvoiceID_W = null;
				_IsRetail_W = null;
				_IsRedo_W = null;
				_RepairBoxID_W = null;
				_PreviousStatusID_W = null;
				_LoanPhoneID_W = null;
				_LoanPhoneReturn_W = null;
				_BranchID_W = null;
				_InvoiceDetailID_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter RepairNo
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.RepairNo, Parameters.RepairNo);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter RepairModelID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.RepairModelID, Parameters.RepairModelID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IMEI
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IMEI, Parameters.IMEI);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter StatusID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.StatusID, Parameters.StatusID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Note
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Note, Parameters.Note);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Accessories
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Accessories, Parameters.Accessories);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CustomerID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CustomerID, Parameters.CustomerID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CustomerName
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CustomerName, Parameters.CustomerName);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CustomerPhone
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CustomerPhone, Parameters.CustomerPhone);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter Deleted
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.Deleted, Parameters.Deleted);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LastModifiedDate
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LastModifiedDate, Parameters.LastModifiedDate);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LastModifiedByUser
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LastModifiedByUser, Parameters.LastModifiedByUser);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CreatedDate
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CreatedDate, Parameters.CreatedDate);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CreatedByUser
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CreatedByUser, Parameters.CreatedByUser);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter InvoiceID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.InvoiceID, Parameters.InvoiceID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IsRetail
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IsRetail, Parameters.IsRetail);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter IsRedo
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.IsRedo, Parameters.IsRedo);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter RepairBoxID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.RepairBoxID, Parameters.RepairBoxID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter PreviousStatusID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.PreviousStatusID, Parameters.PreviousStatusID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LoanPhoneID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LoanPhoneID, Parameters.LoanPhoneID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter LoanPhoneReturn
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.LoanPhoneReturn, Parameters.LoanPhoneReturn);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter BranchID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.BranchID, Parameters.BranchID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter InvoiceDetailID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.InvoiceDetailID, Parameters.InvoiceDetailID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public AggregateParameter RepairNo
		    {
				get
		        {
					if(_RepairNo_W == null)
	        	    {
						_RepairNo_W = TearOff.RepairNo;
					}
					return _RepairNo_W;
				}
			}

			public AggregateParameter RepairModelID
		    {
				get
		        {
					if(_RepairModelID_W == null)
	        	    {
						_RepairModelID_W = TearOff.RepairModelID;
					}
					return _RepairModelID_W;
				}
			}

			public AggregateParameter IMEI
		    {
				get
		        {
					if(_IMEI_W == null)
	        	    {
						_IMEI_W = TearOff.IMEI;
					}
					return _IMEI_W;
				}
			}

			public AggregateParameter StatusID
		    {
				get
		        {
					if(_StatusID_W == null)
	        	    {
						_StatusID_W = TearOff.StatusID;
					}
					return _StatusID_W;
				}
			}

			public AggregateParameter Note
		    {
				get
		        {
					if(_Note_W == null)
	        	    {
						_Note_W = TearOff.Note;
					}
					return _Note_W;
				}
			}

			public AggregateParameter Accessories
		    {
				get
		        {
					if(_Accessories_W == null)
	        	    {
						_Accessories_W = TearOff.Accessories;
					}
					return _Accessories_W;
				}
			}

			public AggregateParameter CustomerID
		    {
				get
		        {
					if(_CustomerID_W == null)
	        	    {
						_CustomerID_W = TearOff.CustomerID;
					}
					return _CustomerID_W;
				}
			}

			public AggregateParameter CustomerName
		    {
				get
		        {
					if(_CustomerName_W == null)
	        	    {
						_CustomerName_W = TearOff.CustomerName;
					}
					return _CustomerName_W;
				}
			}

			public AggregateParameter CustomerPhone
		    {
				get
		        {
					if(_CustomerPhone_W == null)
	        	    {
						_CustomerPhone_W = TearOff.CustomerPhone;
					}
					return _CustomerPhone_W;
				}
			}

			public AggregateParameter Deleted
		    {
				get
		        {
					if(_Deleted_W == null)
	        	    {
						_Deleted_W = TearOff.Deleted;
					}
					return _Deleted_W;
				}
			}

			public AggregateParameter LastModifiedDate
		    {
				get
		        {
					if(_LastModifiedDate_W == null)
	        	    {
						_LastModifiedDate_W = TearOff.LastModifiedDate;
					}
					return _LastModifiedDate_W;
				}
			}

			public AggregateParameter LastModifiedByUser
		    {
				get
		        {
					if(_LastModifiedByUser_W == null)
	        	    {
						_LastModifiedByUser_W = TearOff.LastModifiedByUser;
					}
					return _LastModifiedByUser_W;
				}
			}

			public AggregateParameter CreatedDate
		    {
				get
		        {
					if(_CreatedDate_W == null)
	        	    {
						_CreatedDate_W = TearOff.CreatedDate;
					}
					return _CreatedDate_W;
				}
			}

			public AggregateParameter CreatedByUser
		    {
				get
		        {
					if(_CreatedByUser_W == null)
	        	    {
						_CreatedByUser_W = TearOff.CreatedByUser;
					}
					return _CreatedByUser_W;
				}
			}

			public AggregateParameter InvoiceID
		    {
				get
		        {
					if(_InvoiceID_W == null)
	        	    {
						_InvoiceID_W = TearOff.InvoiceID;
					}
					return _InvoiceID_W;
				}
			}

			public AggregateParameter IsRetail
		    {
				get
		        {
					if(_IsRetail_W == null)
	        	    {
						_IsRetail_W = TearOff.IsRetail;
					}
					return _IsRetail_W;
				}
			}

			public AggregateParameter IsRedo
		    {
				get
		        {
					if(_IsRedo_W == null)
	        	    {
						_IsRedo_W = TearOff.IsRedo;
					}
					return _IsRedo_W;
				}
			}

			public AggregateParameter RepairBoxID
		    {
				get
		        {
					if(_RepairBoxID_W == null)
	        	    {
						_RepairBoxID_W = TearOff.RepairBoxID;
					}
					return _RepairBoxID_W;
				}
			}

			public AggregateParameter PreviousStatusID
		    {
				get
		        {
					if(_PreviousStatusID_W == null)
	        	    {
						_PreviousStatusID_W = TearOff.PreviousStatusID;
					}
					return _PreviousStatusID_W;
				}
			}

			public AggregateParameter LoanPhoneID
		    {
				get
		        {
					if(_LoanPhoneID_W == null)
	        	    {
						_LoanPhoneID_W = TearOff.LoanPhoneID;
					}
					return _LoanPhoneID_W;
				}
			}

			public AggregateParameter LoanPhoneReturn
		    {
				get
		        {
					if(_LoanPhoneReturn_W == null)
	        	    {
						_LoanPhoneReturn_W = TearOff.LoanPhoneReturn;
					}
					return _LoanPhoneReturn_W;
				}
			}

			public AggregateParameter BranchID
		    {
				get
		        {
					if(_BranchID_W == null)
	        	    {
						_BranchID_W = TearOff.BranchID;
					}
					return _BranchID_W;
				}
			}

			public AggregateParameter InvoiceDetailID
		    {
				get
		        {
					if(_InvoiceDetailID_W == null)
	        	    {
						_InvoiceDetailID_W = TearOff.InvoiceDetailID;
					}
					return _InvoiceDetailID_W;
				}
			}

			private AggregateParameter _ID_W = null;
			private AggregateParameter _RepairNo_W = null;
			private AggregateParameter _RepairModelID_W = null;
			private AggregateParameter _IMEI_W = null;
			private AggregateParameter _StatusID_W = null;
			private AggregateParameter _Note_W = null;
			private AggregateParameter _Accessories_W = null;
			private AggregateParameter _CustomerID_W = null;
			private AggregateParameter _CustomerName_W = null;
			private AggregateParameter _CustomerPhone_W = null;
			private AggregateParameter _Deleted_W = null;
			private AggregateParameter _LastModifiedDate_W = null;
			private AggregateParameter _LastModifiedByUser_W = null;
			private AggregateParameter _CreatedDate_W = null;
			private AggregateParameter _CreatedByUser_W = null;
			private AggregateParameter _InvoiceID_W = null;
			private AggregateParameter _IsRetail_W = null;
			private AggregateParameter _IsRedo_W = null;
			private AggregateParameter _RepairBoxID_W = null;
			private AggregateParameter _PreviousStatusID_W = null;
			private AggregateParameter _LoanPhoneID_W = null;
			private AggregateParameter _LoanPhoneReturn_W = null;
			private AggregateParameter _BranchID_W = null;
			private AggregateParameter _InvoiceDetailID_W = null;

			public void AggregateClauseReset()
			{
				_ID_W = null;
				_RepairNo_W = null;
				_RepairModelID_W = null;
				_IMEI_W = null;
				_StatusID_W = null;
				_Note_W = null;
				_Accessories_W = null;
				_CustomerID_W = null;
				_CustomerName_W = null;
				_CustomerPhone_W = null;
				_Deleted_W = null;
				_LastModifiedDate_W = null;
				_LastModifiedByUser_W = null;
				_CreatedDate_W = null;
				_CreatedByUser_W = null;
				_InvoiceID_W = null;
				_IsRetail_W = null;
				_IsRedo_W = null;
				_RepairBoxID_W = null;
				_PreviousStatusID_W = null;
				_LoanPhoneID_W = null;
				_LoanPhoneReturn_W = null;
				_BranchID_W = null;
				_InvoiceDetailID_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_RepairJobInsert]";
	
			CreateParameters(cmd);
			
			SqlParameter p;
			p = cmd.Parameters[Parameters.ID.ParameterName];
			p.Direction = ParameterDirection.Output;
    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_RepairJobUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_RepairJobDelete]";
	
			SqlParameter p;
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SqlCommand cmd)
		{
			SqlParameter p;
		
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.RepairNo);
			p.SourceColumn = ColumnNames.RepairNo;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.RepairModelID);
			p.SourceColumn = ColumnNames.RepairModelID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IMEI);
			p.SourceColumn = ColumnNames.IMEI;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.StatusID);
			p.SourceColumn = ColumnNames.StatusID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Note);
			p.SourceColumn = ColumnNames.Note;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Accessories);
			p.SourceColumn = ColumnNames.Accessories;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CustomerID);
			p.SourceColumn = ColumnNames.CustomerID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CustomerName);
			p.SourceColumn = ColumnNames.CustomerName;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CustomerPhone);
			p.SourceColumn = ColumnNames.CustomerPhone;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.Deleted);
			p.SourceColumn = ColumnNames.Deleted;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LastModifiedDate);
			p.SourceColumn = ColumnNames.LastModifiedDate;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LastModifiedByUser);
			p.SourceColumn = ColumnNames.LastModifiedByUser;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CreatedDate);
			p.SourceColumn = ColumnNames.CreatedDate;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CreatedByUser);
			p.SourceColumn = ColumnNames.CreatedByUser;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.InvoiceID);
			p.SourceColumn = ColumnNames.InvoiceID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IsRetail);
			p.SourceColumn = ColumnNames.IsRetail;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.IsRedo);
			p.SourceColumn = ColumnNames.IsRedo;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.RepairBoxID);
			p.SourceColumn = ColumnNames.RepairBoxID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.PreviousStatusID);
			p.SourceColumn = ColumnNames.PreviousStatusID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LoanPhoneID);
			p.SourceColumn = ColumnNames.LoanPhoneID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.LoanPhoneReturn);
			p.SourceColumn = ColumnNames.LoanPhoneReturn;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.BranchID);
			p.SourceColumn = ColumnNames.BranchID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.InvoiceDetailID);
			p.SourceColumn = ColumnNames.InvoiceDetailID;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
